home *** CD-ROM | disk | FTP | other *** search
Text File | 1998-09-25 | 946 b | 50 lines | [TEXT/CWIE] |
- /*
- File: MoreQuickDraw.cp
-
- Contains: duh
-
- Written by: Pete Gontier (PCG)
-
- Copyright: Copyright (c) 1998 Apple Computer, Inc.
-
- Change History (most recent first):
-
- <2> 8/28/98 PCG add IsColorGrafPort
- <1> 6/16/98 PCG initial checkin
- */
-
-
- #include "MoreQuickDraw.h"
-
- #ifndef __GESTALT__
- # include <Gestalt.h>
- #endif
-
- static long gQuickDrawVersion;
-
- pascal Boolean HaveColorQuickDraw (void)
- {
- // the "features" selector is wrong; test the version instead
- return gQuickDrawVersion > gestaltOriginalQD;
- }
-
- pascal OSErr InitMoreQuickDraw (void)
- {
- OSErr err = Gestalt (gestaltQuickdrawVersion,&gQuickDrawVersion);
-
- if (err == gestaltUndefSelectorErr)
- {
- gQuickDrawVersion = gestaltOriginalQD;
- err = noErr;
- }
-
- return err;
- }
-
- pascal Boolean IsColorGrafPort (GrafPtr port)
- {
- // stolen from {CommonSystem}:Toolbox:ToolboxUtils:CommonHeaders:ColorUtils.h
-
- return ((CGrafPtr) port)->portVersion < 0;
- }
-